{include file="public/header" /}
<style type="text/css">
	.float-e-margins .btn{margin: 0!important;}
	.laydate-icon{background-image: none!important;}
	.choose_time{width: 80px;}
	td i{font-style: normal;}
	td img{cursor:pointer;width: 8rem;}
</style>
<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">
    <!-- Panel Other -->
    <div class="ibox float-e-margins">
        <div class="ibox-title">
            <h5>用户列表</h5>
        </div>
        <div class="ibox-content">
            <!--搜索框开始-->           
            <div class="row">
	                <form name="users" class="form-search form-inline" method="post" action="{:url('')}">
						<div class="col-md-2">
							<div class="form-group">
						        <input class="form-control" type="text" name="name" value="{if !empty($name)}{$name}{/if}"  placeholder="姓名模糊查询">
							</div>
						</div>
						<!--<div class="col-sm-3">
                        	<div class="input-group">
				        		<span class="input-group-btn"><i class="btn btn-primary" style="font-style: normal;">身份：</i></span>
	                                <select class="form-control m-b" name="type">
	                                 	<option value="">&#45;&#45;选择身份&#45;&#45;</option>
	                                 	<option value="1">准租客</option>
	                                 	<option value="2">租客</option>
	                                 	<option value="3">业主</option>
                                 	</select>
							</div>
						</div>-->
						<!--<div class="col-md-2">
							<div class="form-group">
						        <input class="form-control choose_time" type="text" name="stime" value="{if input('stime')!=0}{:input('stime')}{/if}"  placeholder="创建开始时间">
							</div>
						</div>
	                	<div class="col-md-2">
	                		<div class="form-group">
						        <input class="form-control choose_time" type="text" name="etime" value="{if input('etime')!=0}{:input('etime')}{/if}"  placeholder="创建结束时间">
	                       </div>
	                	</div>-->
						<div class="col-md-1">
							<div class="form-group">
								<button class="btn btn-outline btn-primary" type="submit">
									<i class="fa fa-search"></i>搜索
								</button>
							</div>
						</div>
					  	<div class="col-md-1">
					  		<div class="form-group">
								<button class="btn btn-outline btn-primary" type="button"  onClick="export_excel();">导出数据</button>
							</div>
					  	</div>
	              </form>
            </div>
            <!--搜索框结束-->
            <div class="hr-line-dashed"></div>
            <div class="example-wrap">
                <div class="example">
                    <table class="table table-bordered table-hover">
                        <thead>
                            <tr class="long-tr">
								<th>用户id</th>
								<th>用户名称</th>
								<th>微信号</th>
								<th>已通过关卡</th>
								<th>积分</th>
								<th>已兑换优惠券数量</th>
								<th>创建时间</th>
                            	<th>状态</th>
                            	<th>操作</th>
                            </tr>
                        </thead>
                        <tbody>
                    		{volist name="data" id="item" empty="$empty"}
                        	<tr class="long-td">
								<td>{$item.ids}</td>
								<td>{$item.name}</td>
								<td>{$item.wechatphone}</td>							
								<td>{$item.levelnum}</td>
								<td>{$item.integral}</td>								
								<td>
									{if condition="$item.makecouponnum eq 0"}
									<font color = 'green'>未兑换</font>
									{else/}
									{$item.makecouponnum}
									{/if}
								</td>
								<td>
									{if condition="$item.ctime eq 0"}
									{$item.ctime}
									{else/}
									{$item.ctime|date='Y-m-d H:i:s',###}
									{/if}
								</td>
								<td>
									{if condition = '$item.stat eq 1'}
									<font color = 'green'>正常</font>
									{else/}
									<font color = 'red'>隐藏</font>
									{/if}
								</td>
                        		<td>
                        			<!--<a href="javascript:;" onclick="edit({$item.ids})" class="btn btn-primary btn-outline btn-xs">
                                        <i class="fa fa-paste"></i> 编辑</a>&nbsp;&nbsp;-->
                                    <a href="javascript:;" onclick="del({$item.ids})" class="btn btn-danger btn-outline btn-xs">
                                        <i class="fa fa-trash-o"></i> 删除</a>
                        		</td>
                        		
                        	</tr>
                        	{/volist}
                        </tbody>
                    </table>
                    <div style="text-align: right;">{$page}</div>
                </div>
            </div>
            <!-- End Example Pagination -->
        </div>
    </div>
</div>
<!-- End Panel Other -->
</div>
{include file="public/footer" /}

<script type="text/javascript">



//查看点评
function remark(id,goods_name){
	location.href = "{:url('remark')}?goods_id="+id+"&goods_name="+goods_name;
}
//编辑程序
function edit(id){
    location.href = "{:url('edit_goods')}?goods_id="+id;
}
//
//更改VIP是否收费
function change_stat(_this,id,key){
    lunhui.change_stat(_this,'users','id',id,key,'{:url("index/change_stat")}');
}
//删除
function del(id){
	var url = '{:url("users/del")}';
	//alert(id);
	$.post(url,{"id":id},function(json){
		//alert(json.msg);
		if(json.code==1){
			layer.msg(json.msg);
			setInterval(function() {
             window.location.reload();
             layer.getFrameIndex(window.name);
             layer.close(index);
            }, 1000);
		}else{
			layer.msg(json.msg);
		}		
		//alert(json);
		return false;
	
	})
	
}
</script>
</body>
</html>